1. Technical Field
The present invention relates in general to data processing and in particular to managing physical memory in a data processing system. Still more particularly, the present invention relates to a method and system for managing physical memory in a data processing system autonomously from operating system control.
2. Description of the Related Art
In computer systems it is customary that there be one-to-one correspondence between the memory address produced by the processor and a specific area in the physical memory of the system. This limits the operating system and applications to an address space determined by the actual physical memory installed in the system. Moreover, many modem computer systems run multiple concurrent tasks or processes, each with its own address space. It would be expensive to dedicate a full complement of memory to each task and the operating system, especially since many processes use only a small part of their address spaces at any given time. Modern computer systems have overcome this limitation through the use of virtual memory, which implements a translation table to map program addresses (or virtual addresses) to real memory addresses. Virtual memory allows a program to run on what appears to be a large, contiguous, physical-memory address space, dedicated entirely to the program. In reality, however, the available physical memory in a virtual memory system is shared between multiple programs or processes. Virtual addresses used in a process are translated by a combination of computer hardware and software to real addresses of physical memory. This process is called memory mapping or address translation.
In a virtual memory system, the allocation of memory is most commonly performed by the operating system software (OS). It is a function of the operating system to ensure that the data and code a program is currently using is in main memory and that the translation table can map the virtual addresses to the real addresses correctly. This requires an interrupt of the instruction sequence so that the privileged kernel code can allocate physical memory to the area being accessed so that normal program flow can continue without error. This interrupt and the kernel processing to allocate physical memory requires a significant amount of processing time and upsets the normal pipelining of instructions through the CPU.
The burden on the operating system of managing physical memory increases when the physical memory is reconfigured while the computer system is in operation. In cases where the physical memory size is increased or decreased, or when a memory module is replaced during system operation (for example, when a failure occurs in a memory module requiring replacement), the OS is required to temporarily interrupt the task being processed, modify the system memory configuration information in the translation table, and use the changed physical addresses to store data from the bad memory device out to disk, and then reconfigure the remaining memory devices. If a memory device has been removed, the OS must invalidate the physical address space of the removed device and maintain the invalidated address space so that it can not be used, essentially leaving an unavailable block of space within the addressable space of the memory system. The operating system must then map logical addresses to physical addresses to avoid pages with bad memory locations. These problems increase the overhead of the OS and complicate the control of memory. What is needed is a method and system for physical memory control capable of solving the above-described problems of the prior art and quickly and efficiently implementing dynamic reconfiguration of physical memory as required.